package com.wd.elec.service.impl;

import java.util.List;
import com.wd.common.utils.DateUtils;
import org.springframework.stereotype.Service;
import com.wd.elec.mapper.AttendScheduleMapper;
import com.wd.elec.domain.AttendSchedule;
import com.wd.elec.service.IAttendScheduleService;

import javax.annotation.Resource;

/**
 * 考勤班次Service业务层处理
 * 
 * @author liumingkun
 * @date 2023-11-07
 */
@Service
public class AttendScheduleService implements IAttendScheduleService
{
    @Resource
    private AttendScheduleMapper attendScheduleMapper;

    /**
     * 查询考勤班次
     * 
     * @param scheduleId 考勤班次主键
     * @return 考勤班次
     */
    @Override
    public AttendSchedule selectAttendScheduleByScheduleId(Long scheduleId)
    {
        return attendScheduleMapper.selectAttendScheduleByScheduleId(scheduleId);
    }

    /**
     * 查询考勤班次列表
     * 
     * @param attendSchedule 考勤班次
     * @return 考勤班次
     */
    @Override
    public List<AttendSchedule> selectAttendScheduleList(AttendSchedule attendSchedule)
    {
        return attendScheduleMapper.selectAttendScheduleList(attendSchedule);
    }

    /**
     * 新增考勤班次
     * 
     * @param attendSchedule 考勤班次
     * @return 结果
     */
    @Override
    public int insertAttendSchedule(AttendSchedule attendSchedule)
    {
        attendSchedule.setCreateTime(DateUtils.getNowDate());
        return attendScheduleMapper.insertAttendSchedule(attendSchedule);
    }

    /**
     * 修改考勤班次
     * 
     * @param attendSchedule 考勤班次
     * @return 结果
     */
    @Override
    public int updateAttendSchedule(AttendSchedule attendSchedule)
    {
        attendSchedule.setUpdateTime(DateUtils.getNowDate());
        return attendScheduleMapper.updateAttendSchedule(attendSchedule);
    }

    /**
     * 批量删除考勤班次
     * 
     * @param scheduleIds 需要删除的考勤班次主键
     * @return 结果
     */
    @Override
    public int deleteAttendScheduleByScheduleIds(Long[] scheduleIds)
    {
        return attendScheduleMapper.deleteAttendScheduleByScheduleIds(scheduleIds);
    }

    /**
     * 删除考勤班次信息
     * 
     * @param scheduleId 考勤班次主键
     * @return 结果
     */
    @Override
    public int deleteAttendScheduleByScheduleId(Long scheduleId)
    {
        return attendScheduleMapper.deleteAttendScheduleByScheduleId(scheduleId);
    }
}
